-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ASM][ATO] Collect session id at all times #6623
base: master
Are you sure you want to change the base?
Conversation
Datadog ReportBranch report: ❌ 121 Failed (0 Known Flaky), 244485 Passed, 2226 Skipped, 18h 48m 39.81s Total Time ❌ Failed Tests (121)
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing the following branches/commits: Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6623) - mean (69ms) : 66, 71
. : milestone, 69,
master - mean (69ms) : 66, 72
. : milestone, 69,
section CallTarget+Inlining+NGEN
This PR (6623) - mean (991ms) : 968, 1014
. : milestone, 991,
master - mean (992ms) : 960, 1024
. : milestone, 992,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6623) - mean (102ms) : 100, 104
. : milestone, 102,
master - mean (102ms) : 100, 104
. : milestone, 102,
section CallTarget+Inlining+NGEN
This PR (6623) - mean (670ms) : 650, 691
. : milestone, 670,
master - mean (674ms) : 659, 690
. : milestone, 674,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6623) - mean (89ms) : 87, 91
. : milestone, 89,
master - mean (89ms) : 87, 91
. : milestone, 89,
section CallTarget+Inlining+NGEN
This PR (6623) - mean (625ms) : 606, 645
. : milestone, 625,
master - mean (630ms) : 615, 645
. : milestone, 630,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6623) - mean (191ms) : 186, 196
. : milestone, 191,
master - mean (191ms) : 188, 195
. : milestone, 191,
section CallTarget+Inlining+NGEN
This PR (6623) - mean (1,102ms) : 1072, 1132
. : milestone, 1102,
master - mean (1,105ms) : 1077, 1133
. : milestone, 1105,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6623) - mean (271ms) : 266, 275
. : milestone, 271,
master - mean (272ms) : 266, 278
. : milestone, 272,
section CallTarget+Inlining+NGEN
This PR (6623) - mean (863ms) : 820, 905
. : milestone, 863,
master - mean (868ms) : 834, 903
. : milestone, 868,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6623) - mean (265ms) : 259, 271
. : milestone, 265,
master - mean (262ms) : 258, 266
. : milestone, 262,
section CallTarget+Inlining+NGEN
This PR (6623) - mean (850ms) : 819, 881
. : milestone, 850,
master - mean (849ms) : 811, 886
. : milestone, 849,
|
Benchmarks Report for appsec 🐌Benchmarks for #6623 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.Asm.AppSecBodyBenchmark - Slower
|
Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody‑net6.0 | 1.130 | 191,118.65 | 215,897.85 | |
Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody‑net6.0 | 1.116 | 187,764.85 | 209,544.79 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | AllCycleSimpleBody |
net6.0 | 188μs | 180ns | 674ns | 2.74 | 0 | 0 | 193.47 KB |
master | AllCycleSimpleBody |
netcoreapp3.1 | 281μs | 486ns | 1.88μs | 2.72 | 0 | 0 | 200.94 KB |
master | AllCycleSimpleBody |
net472 | 257μs | 198ns | 766ns | 36.8 | 2.04 | 0 | 231.51 KB |
master | AllCycleMoreComplexBody |
net6.0 | 191μs | 111ns | 416ns | 2.77 | 0 | 0 | 196.98 KB |
master | AllCycleMoreComplexBody |
netcoreapp3.1 | 298μs | 229ns | 887ns | 2.68 | 0 | 0 | 204.36 KB |
master | AllCycleMoreComplexBody |
net472 | 262μs | 396ns | 1.54μs | 37.3 | 2.09 | 0 | 235.03 KB |
master | ObjectExtractorSimpleBody |
net6.0 | 141ns | 0.426ns | 1.86ns | 0.00391 | 0 | 0 | 280 B |
master | ObjectExtractorSimpleBody |
netcoreapp3.1 | 201ns | 0.161ns | 0.602ns | 0.00374 | 0 | 0 | 272 B |
master | ObjectExtractorSimpleBody |
net472 | 209ns | 0.117ns | 0.437ns | 0.0446 | 0 | 0 | 281 B |
master | ObjectExtractorMoreComplexBody |
net6.0 | 3.05μs | 11.7ns | 45.3ns | 0.0529 | 0 | 0 | 3.78 KB |
master | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 3.85μs | 2.37ns | 8.54ns | 0.0503 | 0 | 0 | 3.69 KB |
master | ObjectExtractorMoreComplexBody |
net472 | 4.42μs | 2.95ns | 11.4ns | 0.601 | 0.00663 | 0 | 3.8 KB |
#6623 | AllCycleSimpleBody |
net6.0 | 210μs | 65.2ns | 235ns | 2.71 | 0 | 0 | 193.33 KB |
#6623 | AllCycleSimpleBody |
netcoreapp3.1 | 310μs | 142ns | 532ns | 2.78 | 0 | 0 | 200.8 KB |
#6623 | AllCycleSimpleBody |
net472 | 274μs | 189ns | 733ns | 36.7 | 2.05 | 0 | 231.35 KB |
#6623 | AllCycleMoreComplexBody |
net6.0 | 216μs | 86.7ns | 324ns | 2.81 | 0 | 0 | 196.83 KB |
#6623 | AllCycleMoreComplexBody |
netcoreapp3.1 | 324μs | 215ns | 803ns | 2.73 | 0 | 0 | 204.22 KB |
#6623 | AllCycleMoreComplexBody |
net472 | 281μs | 129ns | 482ns | 37.3 | 2.1 | 0 | 234.87 KB |
#6623 | ObjectExtractorSimpleBody |
net6.0 | 139ns | 0.0903ns | 0.338ns | 0.00394 | 0 | 0 | 280 B |
#6623 | ObjectExtractorSimpleBody |
netcoreapp3.1 | 221ns | 0.552ns | 2.14ns | 0.00364 | 0 | 0 | 272 B |
#6623 | ObjectExtractorSimpleBody |
net472 | 208ns | 0.259ns | 1ns | 0.0445 | 0 | 0 | 281 B |
#6623 | ObjectExtractorMoreComplexBody |
net6.0 | 2.92μs | 1.21ns | 4.51ns | 0.0541 | 0 | 0 | 3.78 KB |
#6623 | ObjectExtractorMoreComplexBody |
netcoreapp3.1 | 3.92μs | 1.32ns | 4.93ns | 0.0511 | 0 | 0 | 3.69 KB |
#6623 | ObjectExtractorMoreComplexBody |
net472 | 4.22μs | 2.37ns | 8.53ns | 0.603 | 0.0063 | 0 | 3.8 KB |
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | EncodeArgs |
net6.0 | 37μs | 29.2ns | 113ns | 0.462 | 0 | 0 | 32.4 KB |
master | EncodeArgs |
netcoreapp3.1 | 54.7μs | 22.7ns | 87.8ns | 0.436 | 0 | 0 | 32.4 KB |
master | EncodeArgs |
net472 | 66.8μs | 45.1ns | 175ns | 5.16 | 0.0787 | 0 | 32.5 KB |
master | EncodeLegacyArgs |
net6.0 | 77.2μs | 17.5ns | 65.4ns | 0 | 0 | 0 | 2.14 KB |
master | EncodeLegacyArgs |
netcoreapp3.1 | 107μs | 68.5ns | 256ns | 0 | 0 | 0 | 2.14 KB |
master | EncodeLegacyArgs |
net472 | 152μs | 93.6ns | 363ns | 0.305 | 0 | 0 | 2.15 KB |
#6623 | EncodeArgs |
net6.0 | 37.6μs | 17.8ns | 68.7ns | 0.453 | 0 | 0 | 32.4 KB |
#6623 | EncodeArgs |
netcoreapp3.1 | 54.6μs | 19.8ns | 76.6ns | 0.434 | 0 | 0 | 32.4 KB |
#6623 | EncodeArgs |
net472 | 66.3μs | 81.5ns | 315ns | 5.16 | 0.0661 | 0 | 32.5 KB |
#6623 | EncodeLegacyArgs |
net6.0 | 79.3μs | 70.2ns | 272ns | 0 | 0 | 0 | 2.14 KB |
#6623 | EncodeLegacyArgs |
netcoreapp3.1 | 106μs | 147ns | 531ns | 0 | 0 | 0 | 2.15 KB |
#6623 | EncodeLegacyArgs |
net472 | 153μs | 104ns | 388ns | 0.307 | 0 | 0 | 2.15 KB |
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunWafRealisticBenchmark |
net6.0 | 175μs | 82.2ns | 307ns | 0 | 0 | 0 | 2.54 KB |
master | RunWafRealisticBenchmark |
netcoreapp3.1 | 189μs | 233ns | 901ns | 0 | 0 | 0 | 2.49 KB |
master | RunWafRealisticBenchmark |
net472 | 201μs | 90.1ns | 349ns | 0.398 | 0 | 0 | 2.55 KB |
master | RunWafRealisticBenchmarkWithAttack |
net6.0 | 116μs | 69ns | 249ns | 0 | 0 | 0 | 1.57 KB |
master | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 124μs | 213ns | 824ns | 0 | 0 | 0 | 1.55 KB |
master | RunWafRealisticBenchmarkWithAttack |
net472 | 134μs | 60.8ns | 235ns | 0.199 | 0 | 0 | 1.58 KB |
#6623 | RunWafRealisticBenchmark |
net6.0 | 175μs | 88.3ns | 330ns | 0 | 0 | 0 | 2.54 KB |
#6623 | RunWafRealisticBenchmark |
netcoreapp3.1 | 188μs | 139ns | 500ns | 0 | 0 | 0 | 2.49 KB |
#6623 | RunWafRealisticBenchmark |
net472 | 200μs | 50ns | 194ns | 0.399 | 0 | 0 | 2.55 KB |
#6623 | RunWafRealisticBenchmarkWithAttack |
net6.0 | 117μs | 79.1ns | 306ns | 0 | 0 | 0 | 1.57 KB |
#6623 | RunWafRealisticBenchmarkWithAttack |
netcoreapp3.1 | 123μs | 64ns | 222ns | 0 | 0 | 0 | 1.55 KB |
#6623 | RunWafRealisticBenchmarkWithAttack |
net472 | 134μs | 49.5ns | 192ns | 0.2 | 0 | 0 | 1.58 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ Fewer allocations 🎉
Fewer allocations 🎉 in #6623
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
263.86 KB
254.22 KB
-9.63 KB
-3.65%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472
59.76 KB
54.56 KB
-5.2 KB
-8.70%
Benchmark | Base Allocated | Diff Allocated | Change | Change % |
---|---|---|---|---|
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 263.86 KB | 254.22 KB | -9.63 KB | -3.65% |
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 | 59.76 KB | 54.56 KB | -5.2 KB | -8.70% |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StringConcatBenchmark |
net6.0 | 55.1μs | 301ns | 1.67μs | 0 | 0 | 0 | 43.44 KB |
master | StringConcatBenchmark |
netcoreapp3.1 | 58.5μs | 690ns | 6.69μs | 0 | 0 | 0 | 42.64 KB |
master | StringConcatBenchmark |
net472 | 37μs | 103ns | 387ns | 0 | 0 | 0 | 59.76 KB |
master | StringConcatAspectBenchmark |
net6.0 | 311μs | 3.45μs | 32.3μs | 0 | 0 | 0 | 252.85 KB |
master | StringConcatAspectBenchmark |
netcoreapp3.1 | 337μs | 1.8μs | 11.1μs | 0 | 0 | 0 | 263.86 KB |
master | StringConcatAspectBenchmark |
net472 | 239μs | 1.08μs | 3.91μs | 0 | 0 | 0 | 278.53 KB |
#6623 | StringConcatBenchmark |
net6.0 | 58.2μs | 613ns | 6.1μs | 0 | 0 | 0 | 43.44 KB |
#6623 | StringConcatBenchmark |
netcoreapp3.1 | 53.8μs | 242ns | 906ns | 0 | 0 | 0 | 42.64 KB |
#6623 | StringConcatBenchmark |
net472 | 37.7μs | 101ns | 379ns | 0 | 0 | 0 | 54.56 KB |
#6623 | StringConcatAspectBenchmark |
net6.0 | 293μs | 5.67μs | 56.4μs | 0 | 0 | 0 | 254.07 KB |
#6623 | StringConcatAspectBenchmark |
netcoreapp3.1 | 351μs | 1.75μs | 7.63μs | 0 | 0 | 0 | 254.22 KB |
#6623 | StringConcatAspectBenchmark |
net472 | 269μs | 4.42μs | 41.7μs | 0 | 0 | 0 | 278.53 KB |
Benchmarks Report for tracer 🐌Benchmarks for #6623 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Faster 🎉 Same allocations ✔️
|
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net472 | 1.162 | 665.48 | 572.85 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | StartFinishSpan |
net6.0 | 403ns | 0.44ns | 1.71ns | 0.00802 | 0 | 0 | 576 B |
master | StartFinishSpan |
netcoreapp3.1 | 600ns | 0.81ns | 3.14ns | 0.00776 | 0 | 0 | 576 B |
master | StartFinishSpan |
net472 | 665ns | 1.36ns | 5.26ns | 0.0917 | 0 | 0 | 578 B |
master | StartFinishScope |
net6.0 | 531ns | 0.752ns | 2.91ns | 0.0098 | 0 | 0 | 696 B |
master | StartFinishScope |
netcoreapp3.1 | 771ns | 1.3ns | 5.05ns | 0.00955 | 0 | 0 | 696 B |
master | StartFinishScope |
net472 | 857ns | 2.43ns | 9.41ns | 0.104 | 0 | 0 | 658 B |
#6623 | StartFinishSpan |
net6.0 | 398ns | 0.401ns | 1.5ns | 0.00819 | 0 | 0 | 576 B |
#6623 | StartFinishSpan |
netcoreapp3.1 | 578ns | 0.54ns | 2.09ns | 0.00768 | 0 | 0 | 576 B |
#6623 | StartFinishSpan |
net472 | 572ns | 0.995ns | 3.85ns | 0.0915 | 0 | 0 | 578 B |
#6623 | StartFinishScope |
net6.0 | 480ns | 0.686ns | 2.66ns | 0.00983 | 0 | 0 | 696 B |
#6623 | StartFinishScope |
netcoreapp3.1 | 707ns | 2.37ns | 9.17ns | 0.00928 | 0 | 0 | 696 B |
#6623 | StartFinishScope |
net472 | 850ns | 1.59ns | 6.15ns | 0.104 | 0 | 0 | 658 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Faster 🎉 Same allocations ✔️
Faster 🎉 in #6623
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1
1.136
1,063.17
935.64
Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
---|---|---|---|---|
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 | 1.136 | 1,063.17 | 935.64 |
Raw results
Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|---|
master | RunOnMethodBegin |
net6.0 | 686ns | 0.566ns | 2.19ns | 0.00983 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
netcoreapp3.1 | 1.06μs | 1.21ns | 4.67ns | 0.00952 | 0 | 0 | 696 B |
master | RunOnMethodBegin |
net472 | 1.15μs | 0.573ns | 2.14ns | 0.104 | 0 | 0 | 658 B |
#6623 | RunOnMethodBegin |
net6.0 | 644ns | 1.33ns | 5.15ns | 0.00968 | 0 | 0 | 696 B |
#6623 | RunOnMethodBegin |
netcoreapp3.1 | 935ns | 1.08ns | 4.18ns | 0.00935 | 0 | 0 | 696 B |
#6623 | RunOnMethodBegin |
net472 | 1.09μs | 2.61ns | 10.1ns | 0.104 | 0 | 0 | 658 B |
Snapshots difference summaryThe following differences have been observed in committed snapshots. It is meant to help the reviewer. 36 occurrences of : - _dd.appsec.fp.session: ssn--bd9bce81-d0fff5a7-,
+ _dd.appsec.fp.session: ssn--bd9bce81-d0fff5a7-<SessionFp>,
82 occurrences of : + _dd.appsec.fp.session: ssn----<SessionFp>,
1 occurrences of : - _dd.appsec.fp.session: ssn-5860faf0---,
+ _dd.appsec.fp.session: ssn-5860faf0---<SessionFp>,
11 occurrences of : - _dd.appsec.fp.session: ssn-<fingerprint>,
+ _dd.appsec.fp.session: ssn-7bcd1c9f---<SessionFp>,
3 occurrences of : - _dd.appsec.fp.session: ssn-<fingerprint>,
+ _dd.appsec.fp.session: ssn-ef8eb89f---<SessionFp>,
50 occurrences of : + _dd.appsec.fp.session: ssn--<CookieFields>-<CookieValues>-<SessionFp>,
3 occurrences of : - _dd.appsec.s.req.cookies: [{"cookie-key":[8]}],
+ _dd.appsec.s.req.cookies: [{"ASP.NET_SessionId":[8],"cookie-key":[8]}],
|
bc3fe93
to
6ff252f
Compare
a5b6a37
to
1727f6b
Compare
…ride the sdk value
Scrub session and cookies fingerprint when authentication
1727f6b
to
4ff5982
Compare
Summary of changes
Collects session id in any case:
User doesn't need to be authenticated anymore for it to collect the session id.
Reason for change
Session id should always be collected, not only when user is authenticated.
Implementation details
there are guards for netcore as accessing Session when it's not been setup just throws. So this way we make sure it's setup for the webapp.
Test coverage
Change all snapshots.
Scrubbing pitfalls:
Other details